package info.techgeek.labs.threads;

public class TestThreads extends Thread {
    char c;
    
    TestThreads(char c) {
        this.c = c;
    }        
    
//    public void run() {
//        for(int i=0; i<100; i++) {
//            System.out.print(c);
//        }
//    }

    public void run() {
        for(int i=0; i<10; i++) {
            System.out.println(c);
            System.out.println(i	 + " " + getName());
            try{ 
                sleep((int)(Math.random() * 10));
            } catch( InterruptedException e ) {
                System.out.println("Interrupted");
            }
        }
    }    

    
    
    public static void main(String[] args) {

    	TestThreads bt  = new TestThreads('!');
    	TestThreads bt1 = new TestThreads('*');

		    // start RunBasicThread objects as threads
		    new Thread(bt).start();    
		    new Thread(bt1).start();
		}
}

